package cn.four.hqServer.modules.schedu;

import cn.four.hqServer.modules.account.service.ZnbIHqUserBalanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Schedu {

    @Autowired
    private ZnbIHqUserBalanceService userBalanceService;

    /**
     * 计入用户余额日记表，每日一次
     */
//    @Scheduled(cron ="*/6 * * * * ?")
    public void test() {
        System.out.println("hello word");
    }

    /**
     * 计入用户余额日记表，每日一次
     */
    @Scheduled(cron ="55 59 23 * * ?")
    public void everyAdd() {
        userBalanceService.everyAdd();
    }

    /**
     * 结息，每月一次
     */
    @Scheduled(cron ="55 59 23 1 * ?")
    public void sayHello() {
        userBalanceService.interest();
    }
}
